package com.xhwl.logistics.converter.mapstruct;

import com.xhwl.logistics.bo.VehicleCardBO;
import com.xhwl.logistics.bo.input.QueryVehicleCardBO;
import com.xhwl.logistics.dto.query.VehicleCardDTO;
import com.xhwl.logistics.entity.VehicleCard;
import com.xhwl.logistics.vo.VehicleCardVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.NullValueMappingStrategy;

import java.util.List;

@Mapper(componentModel = "spring", nullValueMappingStrategy = NullValueMappingStrategy.RETURN_DEFAULT, uses = {VehicleCommonConverter.class})
public interface VehicleCardConverter {

    //*********Query BO <- Controller DTO*********
    @Mapping(target = "projectIdList", source = "projectIds")
    @Mapping(target = "cardType", qualifiedByName = {"vehicleCardTypeDescription2VehicleCardTypeId"})
    QueryVehicleCardBO vehicleCardDTO2QueryVehicleCardBO(VehicleCardDTO vehicleCardDTO);
    //*********Query BO <- Controller DTO*********

    //*********BO <- Entity*********
    List<VehicleCardBO> vehicleCardList2VehicleCardBOList(List<VehicleCard> vehicleCardList);
    @Mapping(target = "cardType", qualifiedByName = {"vehicleCardTypeId2VehicleCardTypeDescription"})
    VehicleCardBO vehicleCard2VehicleCardBO(VehicleCard vehicleCard);
    //*********BO <- Entity*********

    //*********VO <- BO*********
    List<VehicleCardVO> vehicleCardBOList2VehicleCardVOList(List<VehicleCardBO> vehicleCardBOList);
    VehicleCardVO vehicleCardBO2VehicleCardVO(VehicleCardBO vehicleCardBO);
    //*********VO <- BO*********

}
